<?php

namespace YouBaoLian\Application\Response;

use YouBaoLian\Http\Response;

class VehiclePriceDetailResponse extends Response
{

    private $detailDto = [];

    private $totalPremium = 0;

    private $status = 0;

    private $info = '';

    private $ciBeginDate = '';

    private $ciEndDate = '';

    private $ciPremium = 0;

    private $fcPremium = 0;

    private $ciSlipNo = '';

    private $ciPolicyNo = '';

    private $carshipTax = '';

    private $carshipLaterFee = '';

    private $carBackAmount = '';

    private $biBeginDate = '';

    private $biEndDate = '';

    private $biPremium = '';

    private $biSlipNo = '';

    private $biPolicyNo = '';

    private $bizInfo = [];

    private $carInfo = [];

    private $ownerInfo = [];

    private $applicantInfo = [];

    private $insuredInfo = [];

    private $coverageList = [];

    private $productPlanList = [];

    private $exInfoList = [];

    private $specialClauseList = [];

    private $remark = '';

    public function build(): self
    {
        parent::build();

        $this->detailDto = $this->getBizContent('detailDto', []);

        foreach ($this->detailDto as $key => $value) {
            if (property_exists($this,$key)) {
                $this->$key = $value;
            }
        }
        $this->info = $this->setInfo();

        return $this;
    }


    private function setInfo(): string
    {
        if ($this->status) {
            switch ($this->status) {
                case 2:
                    return '报价成功';
                case 3:
                    return '重复投保';
                case 9:
                    return '报价失败';
                case 20:
                    return '核保退回修改';
                case 22:
                    return '已提核/核保中';
                case 23:
                    return '核保通过/待缴费';
                case 24:
                    return '已支付';
                case 30:
                    return '核保失败';
                case 40:
                    return '已出保单';
                default:
                    return '未知的报价状态:' . $this->status;
            }
        }
        return '';
    }

    /**
     * @return array
     */
    public function getDetailDto(): array
    {
        return $this->detailDto;
    }

    /**
     * @return int
     */
    public function getTotalPremium(): int
    {
        return $this->totalPremium;
    }

    /**
     * @return int
     */
    public function getStatus(): int
    {
        return $this->status;
    }

    /**
     * @return string
     */
    public function getInfo(): string
    {
        return $this->info;
    }

    /**
     * @return string
     */
    public function getCiBeginDate(): string
    {
        return $this->ciBeginDate;
    }

    /**
     * @return string
     */
    public function getCiEndDate(): string
    {
        return $this->ciEndDate;
    }

    /**
     * @return int
     */
    public function getCiPremium(): int
    {
        return $this->ciPremium;
    }

    /**
     * @return int
     */
    public function getFcPremium(): int
    {
        return $this->fcPremium;
    }

    /**
     * @return string
     */
    public function getCiSlipNo(): string
    {
        return $this->ciSlipNo;
    }

    /**
     * @return string
     */
    public function getCiPolicyNo(): string
    {
        return $this->ciPolicyNo;
    }

    /**
     * @return string
     */
    public function getCarshipTax(): string
    {
        return $this->carshipTax;
    }

    /**
     * @return string
     */
    public function getCarshipLaterFee(): string
    {
        return $this->carshipLaterFee;
    }

    /**
     * @return string
     */
    public function getCarBackAmount(): string
    {
        return $this->carBackAmount;
    }

    /**
     * @return string
     */
    public function getBiBeginDate(): string
    {
        return $this->biBeginDate;
    }

    /**
     * @return string
     */
    public function getBiEndDate(): string
    {
        return $this->biEndDate;
    }

    /**
     * @return string
     */
    public function getBiPremium(): string
    {
        return $this->biPremium;
    }

    /**
     * @return string
     */
    public function getBiSlipNo(): string
    {
        return $this->biSlipNo;
    }

    /**
     * @return string
     */
    public function getBiPolicyNo(): string
    {
        return $this->biPolicyNo;
    }

    /**
     * @return array
     */
    public function getBizInfo(): array
    {
        return $this->bizInfo;
    }

    /**
     * @return array
     */
    public function getCarInfo(): array
    {
        return $this->carInfo;
    }

    /**
     * @return array
     */
    public function getOwnerInfo(): array
    {
        return $this->ownerInfo;
    }

    /**
     * @return array
     */
    public function getApplicantInfo(): array
    {
        return $this->applicantInfo;
    }

    /**
     * @return array
     */
    public function getInsuredInfo(): array
    {
        return $this->insuredInfo;
    }

    /**
     * @return array
     */
    public function getCoverageList(): array
    {
        return $this->coverageList;
    }

    /**
     * @return array
     */
    public function getProductPlanList(): array
    {
        return $this->productPlanList;
    }

    /**
     * @return array
     */
    public function getExInfoList(): array
    {
        return $this->exInfoList;
    }

    /**
     * @return array
     */
    public function getSpecialClauseList(): array
    {
        return $this->specialClauseList;
    }

    /**
     * @return string
     */
    public function getRemark(): string
    {
        return $this->remark;
    }
}
